package com.GlobalPaint.app.ui.MessageFragment;

import android.content.DialogInterface;
import android.os.Bundle;
import android.support.v7.app.AlertDialog;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import com.GlobalPaint.app.R;

public class MessegeActivity extends AppCompatActivity {
    String youmeng = "";
    String youmengText = "";
    String youmengTicker = "";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_messege);
        youmengTicker = getIntent().getStringExtra("youmengTicker");
        youmengText = getIntent().getStringExtra("youmengText");
        youmeng = getIntent().getStringExtra("youmeng");
        if(youmeng !=null && youmeng != ""){

        }
        if(youmengTicker !=null && youmengTicker != ""){
            Log.d("jjjjjjj", "onCreate: message");
            AlertDialog.Builder builder = new AlertDialog.Builder(MessegeActivity.this);
            builder.setTitle(youmengTicker);
            builder.setMessage(youmengText);
            builder.setNegativeButton("已读", new DialogInterface.OnClickListener() {
                @Override
                public void onClick(DialogInterface dialog, int which) {
                    dialog.dismiss();
                    /*Intent intent =new Intent(MessegeActivity.this,MainActivity.class);

                    startActivity(intent);*/
                    finish();
                }
            });
            //不关闭写法
            builder.setCancelable(false);
            builder.create();
            if (!MessegeActivity.this.isFinishing()) {
                builder.show();
            }
        }
    }
}
